package org.tang.data;

import java.util.List;

import org.tang.data.common.Constant;
import org.tang.data.common.Utils;

public class GetOrder {


	
	public static void main(String[] args) {
		int count = 0;
		try {
			List<String> dateList = Utils.betweenDate("2013-03-15", "2013-04-11");
			List<String> stocks =  Utils.getStocks();
			for(int i=0;i<dateList.size();i++){
				String dateString = dateList.get(i);
				for(int j=0;j<stocks.size();j++){
					String stockNumber = stocks.get(j);
					String url = Constant.urlPre + dateString + "&symbol=" + stockNumber;
					String filePath = Constant.dirPre + dateString + "\\" + stockNumber + ".txt";
					//System.out.println("start captureHtml -----" + url);
					Utils.captureHtml(url,filePath);

					//System.out.println("captureHtml -----" + url +" end.");
					System.out.println("=======Get count = " + (++count) + "=========");
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	


}
